package routers

import (
	beego "github.com/beego/beego/v2/server/web"
	"news/controllers"
)

func init() {
	beego.Router("/", &controllers.MainController{})

	beego.Router("/user/register", &controllers.UserController{}, "POST:Register")
	beego.Router("/user/login", &controllers.UserController{}, "POST:Login")

	beego.Router("/types/createTypes", &controllers.TypesController{}, "POST:CreateTypes")

	beego.Router("/news/create", &controllers.NewsController{}, "POST:Create")
	beego.Router("/news/upload", &controllers.NewsController{}, "POST:Upload")
	beego.Router("/news/list", &controllers.NewsController{}, "GET:List")
	beego.Router("/news/del", &controllers.NewsController{}, "POST:Del")
	beego.Router("/news/detail", &controllers.NewsController{}, "POST:Detail")
}
